<?php
date_default_timezone_set("PRC");
//header("Content-type: text/html; charset=utf8");
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
require_once ('jpgraph/jpgraph_line.php');

$a=(int)$_GET['a'];
$b=(int)$_GET['b'];
$c=(int)$_GET['c'];
$d=(int)$_GET['d'];
$e=(int)$_GET['e'];
$f=(int)$_GET['f'];

$ydata=array($a,$b,$c,$d,$e,$f);
$labels = array("9:00-10:00","10:00-11:00","11;00-12:00","15:00-16:00","16;00-17:00","17:00-18:00");

$graph = new Graph(500,400);
$graph->img->SetMargin(50,50,50,50);
$graph->SetScale("textlin");
$graph->SetShadow();

//$graph->title->Set('Center the line points in bars');
//设置图表的标题字体、大小
$graph->title->Set(iconv("UTF-8","GB2312//IGNORE","Day table"));
$graph->xaxis->title->Set(iconv("UTF-8","GB2312//IGNORE","times"));
$graph->yaxis->title->Set(iconv("UTF-8","GB2312//IGNORE","sales"));
//和上面标题对应，设置标题的字体和大小
//$graph->title->SetFont(FF_SIMSUN,FS_BOLD,15);
//$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD,12);
//$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD,12);


$line = new LinePlot($ydata);
$line->SetBarCenter();
$line->SetWeight(2);

$bar = new BarPlot($ydata);
$bar2 = new BarPlot($ydata);
$bar2->SetFillColor("red");
$graph->xaxis->SetTickLabels($labels);
$gbar = new GroupbarPlot(array($bar,$bar2));

$graph->Add($gbar);
$graph->Add($line);

// Output line
$graph->Stroke();

?>


